import { ComponentsMgr } from "../Components/ComponentsMgr";
import { EntityIdCreator } from "./EntityIdCreator";
/**
 * 实体数据
 */
export default class DEntity {
    //组件id
    private _eid: number
    constructor() {
        this.id = EntityIdCreator.ins().createEntity();
    }
    public set id(val: number) {
        this._eid = val;
    }
    public get id(): number {
        return this._eid;
    }
    //增加组件
    public addComponent(component) {
        ComponentsMgr.ins().addComponent(this.id, component);
    }
    //使组件生效
    public enableComponent(component) {
        ComponentsMgr.ins().enableComponent(this.id, component)
    }
    //是组件不生效
    public disableComponent(component) {
        ComponentsMgr.ins().disableComponent(this.id, component)
    }
    //移除组件
    public removeComponent(component) {
        ComponentsMgr.ins().removeComponent(this.id, component)
    }

}
